/* Copyright (c) 2012 Research In Motion Limited.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import bb.cascades 1.0

Container {
    id: containerItem
    property alias lyrics: lyrics.text
    property alias title: title.text
    property alias imgFavorite: imgFavorite.imageSource
    property alias code: code.text
    property bool selected : false
    
    background: selected? backgroundPaint.imagePaint : Color.White
    layout: StackLayout {
       orientation: LayoutOrientation.TopToBottom
   }
   /*onTouch: {
       background= Color.create("#d2ffea");
   }
   onTouchExit: {background = Color.White}
    */
    Container {
        layout: StackLayout {
            orientation: LayoutOrientation.LeftToRight
          }
        leftPadding: 15
        Label {
                text: "Người ra đi vì đâu"
              id: title
              layoutProperties: StackLayoutProperties {
                                    spaceQuota: 1
                                }
               textStyle.fontSize: FontSize.Medium
            textStyle.color: Color.Blue
            multiline: selected
        }
        Label {
              id: code
			  textStyle.textAlign: TextAlign.Center
			  textStyle.color: Color.Red
			  preferredWidth: 150
            textStyle.fontSize: FontSize.Medium

            //textStyle.fontSize: FontSize.Large
       }                                        
       }
   Container {
       leftPadding: 10
       layout: StackLayout {
                   orientation: LayoutOrientation.LeftToRight
       }
       ImageView {
           id: imgFavorite
            preferredWidth: 50.0
            preferredHeight: 50.0
       }     
       Label {
         text: "lần đầu đi chơi"
         id: lyrics
         textStyle.fontStyle: FontStyle.Italic
         textStyle.fontSize: FontSize.Small
         textStyle.color: Color.create("#00c409")
        layoutProperties: StackLayoutProperties {
             spaceQuota: 1
         }
         multiline: selected
       }
    }   
    
    ImageView {
        imageSource: "asset:///images/hr.jpg"
    }//imageView                                
    attachedObjects: [
	    ImagePaintDefinition {
	        id: backgroundPaint
	        imageSource: "asset:///images/item-bg.jpg"
            repeatPattern: RepeatPattern.X
        }
	]        
  }
